
<!DOCTYPE html>

<?php
 	error_reporting(E_ALL & ~E_NOTICE);
	session_start();
include('conn.php');
?>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>集鲜蜂商城</title>
    <link rel="stylesheet" href="css/common.css" />
    <link rel="stylesheet" href="css/header.css" />
    <link rel="stylesheet" href="css/goodsList.css" />
	<link rel="stylesheet" href="css/defaul.css">
	
		<link rel="stylesheet" href="canico.css">
</head>
<body>
    <header>
        <div id="head-top" style="margin-top: 5px;">
            <nav class="clearfix">

	  <div class="location" style="">
       <span>地区 ： </span>
      <i class="cd-location">&nbsp;<input type="text" class="selectBoxPub_r flightto" style="border:none;width:50px;background-color:#e6e3e6; font-size: 12px;"></i>
</div>		  
				  
				  
				  
               <ul class="right clearfix" style="">
                   <li class="menu welcome">
                       <?php
						if(!empty($_SESSION['identity'])){
                       echo "<a href='index.php' class='link-login'>主页</a>";}
						
					else{
							echo "<a href='login.php' class='link-login'>你好，请登录</a>";
						}
						
						?>
                    
                    </li>
                    <li class="spacer">|</li>
                    <li class="menu red"><a href="myorder.html" style="color:#999">加入我们</a></li>
                    <li class="spacer">|</li>
                    <li class="menu red">
                    <?php
					if(!empty($_SESSION['identity'])){
                    echo "<a href='myorder.php'>我的订单&nbsp;∨</a>";}
					else{
						 "<a href='#'>我的订单&nbsp;∨</a>";
					}
                    ?>
                    </li>
                    <li class="spacer">|</li>
                    <li class="menu red">企业合作</li>
                    <li class="spacer">|</li>
                    <li class="menu qiye">餐饮采购&nbsp;∨</li>
                    <li class="spacer">|</li>

                </ul>
            </nav>
        </div>
        <div class="w clearfix">
            <div id="logo">
                <a href="index.html"><img src="img/logo.png" ></a>
            </div>
            <div id="search">
                <!-- 搜索列表  已隐藏 -->
                <ul class="menu" id="shelper"></ul>
                <div class="form">
                    <input type="text" id="key" value="水果" class="text blurcolor">
                    <i class="fa fa-camera"></i>
                    <button>搜索</button>
                </div>
            </div>
            <div id="settleup" class="dropdown">
                <div class="cw-icon">
                    <i class="fa fa-shopping-cart car"></i>
                    <i class="i-count" id="count">0</i>
                    <a href="gwc.php" target='_blank'	>我的购物车</a>
                </div>
                
            </div>
            <div id="hotwords" class="haveline clearfix">
                <a href="#">水果</a>
                <b>|</b>
                <a href="#">猪肉</a>
                <b>|</b>
                <a href="#">海鲜</a>
                <b>|</b>
                <a href="#">配料</a>
                <b>|</b>
                <a href="#">调味</a>
                <b>|</b>
                <a href="#">蘑菇</a>
                <b>|</b>
                <a href="#">腌菜</a>
                <b>|</b>
                <a href="#">排骨</a>
                <b>|</b>
                <a href="#">姜</a>
                <b>|</b>
                <a href="#">葱</a>
               
            </div>
        </div>
    </header>
    <section>
        <div id="nav">
            <div class="w clearfix">
                <div id="categorys" style="height: auto; left: 0px; position: absolute;">
                    <div class="dt">
                        <a href="#">采购商城</a>
                    </div>
                    <div class="dd" style="display: none;"></div>
                </div>
                <div id="navitems" class="clearfix">
                    <ul class="navitems-group1 clearfix">

                    </ul>
                    <div class="spacer"></div>
                    
                    <div class="spacer"></div>
                    <ul class="navitems-group3 clearfix">
                        <li><a href="#">&nbsp;&nbsp;&nbsp;&nbsp;肉类&nbsp;&nbsp;&nbsp;&nbsp;</a></li>
                    </ul>
					
                    <ul class="navitems-group3 clearfix">
                        <li><a href="#">蔬菜&nbsp;&nbsp;&nbsp;&nbsp;</a></li>
                    </ul>
				 
					<ul class="navitems-group3 clearfix">
                        <li><a href="#">其他&nbsp;&nbsp;&nbsp;&nbsp;</a></li>
						<li><a href="#">（温馨提示：想要更多食材，请点击更多分类或者在上面的搜索框输入查询）</a></li>
                    </ul>
					
					
                </div>
            </div>
        </div>
		<center>
		<br>
		<br>
		<div id="goods-img">
					
					<div class="img-r" >

						<ul>
						<h2 style="font-size:25px;color:#00c65d;margin-bottom:10px;margin-top:30px;">  · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 肉类 · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · </h2>
						
						<?php
							
							$sql = "select * from caigoushop where type = '肉类'";
							$result = mysqli_query($conn,$sql);
							$goods = array();
							 	while ($row = mysqli_fetch_row($result))
	                            {	

	                              $goods[$i]['goodsid'] = $row[0];	
                                  $goods[$i]['goodsname'] = $row[1];
                                  $goods[$i]['price'] = $row[2];
	                              $goods[$i]['picture']=$row[3];
	                              $goods[$i]['type']=$row[4];
                                  $i++;
	                              }
							foreach ($goods as $value) { 
								
						echo 	"<li>";
						echo		"<a href=''>";
						echo			"<p class='grid-img'>
										<img src='img3/meat/".$value['picture']."' >
									</p>";
						echo			"<h3 class='grid-title'>".$value['goodsname']."</h3>";
						echo			"<p class='grid-desc'>店铺：急鲜蜂自营 </p>";
						echo			"<p class='grid-price'>¥".$value['price']  ."/ 2.5kg</p>";
						echo			"<p class='grid-tips'>
										<img src='' >
									</p>";
						echo		"</a>";
						echo		"<div class='caipux'>";
						echo "<br>";
							/*echo "<div  style='height:58px'>";*/
						echo "<a href=gwcgo.php?goodsname=（采购）" . $value['goodsname'] . '&price=' . $value['price'] . '&picture=' . $value['picture'] . '&storename=集鲜蜂自营',  " style='margin-top:-65px;' target='_blank'>💌 加入购物车</a> "; 
						/*echo      "<a href=''> 💖 收藏</a>  ";*/
						/*echo "<a href='gwc.php' style='margin-top:10px;width:100%;height:20px;margin-top:-65px;'>💌 加购</ a>";   
								echo "</div>";*/
						echo "</div>";
						echo	"</li>";  }   
						
								?>

							<li>
								<a href="">
									<p class="grid-img" style="font-size: 25px;margin-top: 80px;">
										更多分类
									</p>

									<h3 class="grid-title">鲜蜂自营</h3>
									<p class="grid-desc">新鲜速达</p>
									<p class="grid-tips">
										<img src="./static/imgs/h-2.png" alt="">
									</p>
								</a>

							</li>
							<h2 style="font-size:25px;color:#00c65d;margin-bottom:10px;margin-top:30px;">  · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 蔬菜 · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · </h2>
										<?php
							
							$sql = "select * from caigoushop where type = '蔬菜'";
							$result = mysqli_query($conn,$sql);
							$goods = array();
							 	while ($row = mysqli_fetch_row($result))
	                            {	

	                              $goods[$i]['goodsid'] = $row[0];	
                                  $goods[$i]['goodsname'] = $row[1];
                                  $goods[$i]['price'] = $row[2];
	                              $goods[$i]['picture']=$row[3];
	                              $goods[$i]['type']=$row[4];
                                  $i++;
	                              }
							foreach ($goods as $value) { 
						echo 	"<li>";
						echo		"<a href=''>";
						echo			"<p class='grid-img'>
										<img src='img3/vegetables/".$value['picture']."' alt=''>
									</p>";
						echo			"<h3 class='grid-title'>".$value['goodsname']."</h3>";
						echo			"<p class='grid-desc'>店铺：急鲜蜂自营 </p>";
						echo			"<p class='grid-price'>¥".$value['price']  ."/ 2.5kg</p>";
						echo			"<p class='grid-tips'>
										<img src='' alt=''>
									</p>";
						echo		"</a>";
						echo		"<div class='caipux'>";
						echo "<br>";
												echo "<a href=gwcgo.php?goodsname=（自营）" . $value['goodsname'] . '&price=' . $value['price'] . '&picture=' . $value['picture'] . " style='margin-top:-65px;' target='_blank'>💌 加入购物车</a> "; 
						
						echo "</div>";
						echo	"</li>";  }   
						
								?>

							<li>
								<a href="">
									<p class="grid-img" style="font-size: 25px;margin-top: 80px;">
										更多分类
									</p>

									<h3 class="grid-title">鲜蜂自营</h3>
									<p class="grid-desc">新鲜速达</p>
									<p class="grid-tips">
										<img src="./static/imgs/h-2.png" alt="">
									</p>
								</a>

							</li>
							<h2 style="font-size:25px;color:#00c65d;margin-bottom:10px;margin-top:30px;\"> · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·海鲜 · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·  </h2>
									<?php
							
							$sql = "select * from caigoushop where type = '海鲜'";
							$result = mysqli_query($conn,$sql);
							$goods = array();
							 	while ($row = mysqli_fetch_row($result))
	                            {	

	                              $goods[$i]['goodsid'] = $row[0];	
                                  $goods[$i]['goodsname'] = $row[1];
                                  $goods[$i]['price'] = $row[2];
	                              $goods[$i]['picture']=$row[3];
	                              $goods[$i]['type']=$row[4];
                                  $i++;
	                              }
							foreach ($goods as $value) { 
						echo 	"<li>";
						echo		"<a href=''>";
						echo			"<p class='grid-img'>
										<img src='img3/fish/".$value['picture']."' alt=''>
									</p>";
						echo			"<h3 class='grid-title'>".$value['goodsname']."</h3>";
						echo			"<p class='grid-desc'>店铺：急鲜蜂自营 </p>";
						echo			"<p class='grid-price'>¥".$value['price']  ."/ 2.5kg</p>";
						echo			"<p class='grid-tips'>
										<img src='' alt=''>
									</p>";
						echo		"</a>";
						echo		"<div class='caipux'>";
						echo "<br>";
												echo "<a href=gwcgo.php?goodsname=（自营）" . $value['goodsname'] . '&price=' . $value['price'] . '&picture=' . $value['picture'] . " style='margin-top:-65px;' target='_blank'>💌 加入购物车</a> "; 
						
						echo "</div>";
						echo	"</li>";  }   
						
								?>

							<li>
								<a href="">
									<p class="grid-img" style="font-size: 25px;margin-top: 80px;">
										更多分类
									</p>

									<h3 class="grid-title">鲜蜂自营</h3>
									<p class="grid-desc">新鲜速达</p>
									<p class="grid-tips">
										<img src="./static/imgs/h-2.png" alt="">
									</p>
								</a>

							</li>
							<h2 style="font-size:25px;color:#00c65d;margin-bottom:10px;margin-top:30px;\"> · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·水果 · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·  </h2>
									<?php
							
							$sql = "select * from caigoushop where type = '水果'";
							$result = mysqli_query($conn,$sql);
							$goods = array();
							 	while ($row = mysqli_fetch_row($result))
	                            {	

	                              $goods[$i]['goodsid'] = $row[0];	
                                  $goods[$i]['goodsname'] = $row[1];
                                  $goods[$i]['price'] = $row[2];
	                              $goods[$i]['picture']=$row[3];
	                              $goods[$i]['type']=$row[4];
                                  $i++;
	                              }
							foreach ($goods as $value) { 
						echo 	"<li>";
						echo		"<a href=''>";
						echo			"<p class='grid-img'>
										<img src='img3/fruit/".$value['picture']."' alt=''>
									</p>";
						echo			"<h3 class='grid-title'>".$value['goodsname']."</h3>";
						echo			"<p class='grid-desc'>店铺：急鲜蜂自营 </p>";
						echo			"<p class='grid-price'>¥".$value['price']  ."/ 2.5kg</p>";
						echo			"<p class='grid-tips'>
										<img src='' alt=''>
									</p>";
						echo		"</a>";
						echo		"<div class='caipux'>";
						echo "<br>";
												echo "<a href=gwcgo.php?goodsname=（自营）" . $value['goodsname'] . '&price=' . $value['price'] . '&picture=' . $value['picture'] . " style='margin-top:-65px;' target='_blank'>💌 加入购物车</a> "; 
						
						echo "</div>";
						echo	"</li>";  }   
						
								?>

							<li>
								<a href="">
									<p class="grid-img" style="font-size: 25px;margin-top: 80px;">
										更多分类
									</p>

									<h3 class="grid-title">鲜蜂自营</h3>
									<p class="grid-desc">新鲜速达</p>
									<p class="grid-tips">
										<img src="./static/imgs/h-2.png" alt="">
									</p>
								</a>

							</li>
							
						</ul>
						
						
						
    
					</div>
					
		</div>
		
        
		</center>

    </section>
	
</body>
</html>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/velocity.min.js"></script>
<script src="js/myjs.js"></script>
<script src="js/goodsList.js"></script>
<script src="./js/location.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=eFaNjhaFcBEWaqwqs3N5ziq4PKUClOiY"></script>
 <script>
			var isLocate = false; //判断是否定位

			var flightto = document.querySelector(".flightto");
			//获取地理位置定位
			function locateMe() {
				var geolocation = new BMap.Geolocation();
				geolocation.getCurrentPosition(function(r) {
					if(this.getStatus() == BMAP_STATUS_SUCCESS) {
						isLocate = true;
						var url = "http://api.map.baidu.com/geocoder/v2/" +
							"?callback=renderReverse&location=" + r.point.lat + "," + r.point.lng + "&output=json&pois=1&ak=eFaNjhaFcBEWaqwqs3N5ziq4PKUClOiY";
						var JSONP = document.createElement("script");
						JSONP.src = url;
						document.body.appendChild(JSONP);
					} else {
						alert('failed' + this.getStatus());
					}
				}, {
					enableHighAccuracy: true
				})
			}
			locateMe();

			function renderReverse(r) {
				flightto.value = r.result.addressComponent.city;
				console.log(r);
			}
		</script>


